package lotus.blog.lotusblog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lotus.blog.lotusblog.pojo.ArcticleVO;
import lotus.blog.lotusblog.pojo.Article;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface ArticleMapper extends BaseMapper<Article> {
    @Select("select username,article.id,user_id,classification_id,title,release_time,summary from article,user where username=#{name} and article.user_id=user.id")
    public List<Map<String,Object>> getArticleSampleList(@Param("name") String name);
    @Select("select username,article.* from article,user where article.id=#{id} and article.user_id = user.id")
    public ArcticleVO getArticle(@Param("id") int id);

}
